package org.example.Day8;

import java.io.*;

public class Test2 {
    public static void  main(String[] args) {
        InputStream is = null;
        OutputStream os = null;
        try{
            System.out.println(10 / 1);
            //输入流
            is = new FileInputStream("D:/AAAA暑期实训/level2/src/a1.txt");
            os = new FileOutputStream("D:/AAAA暑期实训/level2/src/a1copy.txt");
            System.out.println(10 / 1);
            byte[] buffer = new byte[1024];
            int len;
            while((len = is.read(buffer))!=-1){
                os.write(buffer,0,len);
            }
            System.out.println("复制完成!!");

        }catch (IOException e){
            e.printStackTrace();
        }finally {
            try{
                if(os != null) os.close();
            }catch (IOException e){
                e.printStackTrace();
            }
            try{
                if(is != null )is.close();
            }catch (IOException e){
                e.printStackTrace();
            }
        }
    }
}
